//
//  UITools.h
//  PetClaw
//
//  Created by yihang zhuang on 11/1/12.
//  Copyright (c) 2012 ZQ. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <QuartzCore/QuartzCore.h>
#import "NSDate-Utilities.h"
#import "SDWebImageManager.h"

//date
NSString *formatDateToString( NSDate *date );
NSString *formatDateToStringALL( NSDate *date );
NSString *formatDateToStringALLEx( NSDate *date );
NSDate *formatStringToDate( NSString *string );
NSDate *formatStringToDateEx( NSString *string );
NSDate *formatStringToDateForKD( NSString *string );
NSDate *formatStringToDateMilli( NSString *string );

BOOL is12Hours(void);

NSString *genRandomString(int length);
UIImage *roundCorners(UIImage* img);
void myAddRoundedRectToPath(CGContextRef context, CGRect rect,
                          float ovalWidth,float ovalHeight);

NSString* getDateTime(NSString* str);
NSString* getXTime(NSString* str);

void setExtraCellLineHidden(UITableView *tableView);
void exChangeOut(UIView * changeOutView);

NSString *calcCacheSize(void);
BOOL isDayTime(void);   //是否是白天
BOOL isSameDay(NSDate* date1, NSDate* date2);//是否是同一天
NSInteger minuteInterval(NSDate* fromDate, NSDate* toDate);

UIImage *imageWithColor(UIColor *color, CGSize size ,float alpha);

UIImage * launchImage(void);
UIImage *launchImageWithType(NSString *type);
UIImage* appIcon(void);

/* 获取版本号 */
NSString *getAppVersion(void);

/* 获取IP地址 */
NSString *getLocalIPAddress(void);

//对比版本号
BOOL needUpDataWithNow(NSString* nowVersion, NSString* newVersion);







